using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Niu
{
    public partial class FormMain : Form
    {
        public FormMain()
        {
            InitializeComponent();
        }

        private void Refresh()
        {
            lstDisks.Items.Clear();

            nLogicalDisk[] Disks = nLogicalDisks.GetAll();

            foreach(nLogicalDisk disk in Disks)
            {
                ListViewItem item = new ListViewItem();

                item.Text = disk.Name;
                item.SubItems.Add(disk.VolumeName);
                item.SubItems.Add(disk.Caption);
                item.SubItems.Add(disk.Description);
                item.SubItems.Add(disk.DriveType.ToString());
                item.SubItems.Add(disk.FileSystem);
                item.SubItems.Add(disk.FreeSpace.ToString() + "/" +disk.Size.ToString());

                lstDisks.Items.Add(item);
            }
        }

        private void FormMain_Load(object sender, EventArgs e)
        {
            Refresh();
        }



        private void btnReresh_Click(object sender, EventArgs e)
        {
            Refresh();
        }
    }
}